<%@ page import="cn.entity.Text1" %>
<%@ page import="java.net.URLEncoder" %><%--
  Created by IntelliJ IDEA.
  User: 范军建
  Date: 2022/4/12
  Time: 9:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%

    String username=request.getParameter("username");
    String password=request.getParameter("password");
    if (username.equals("admin")&&password.equals("1234")){
        Text1 text1 = new Text1();
        text1.setUsername(username);
        text1.setPassword(Integer.parseInt(password));
        request.setAttribute("text1" ,text1);
        request.getRequestDispatcher("index2.jsp").forward(request,response);
    }else {
        /*String flag = URLEncoder.encode("用户名不存在或用户密码错误","utf-8");
        *//* session.setAttribute("username",username);*//*
        *//*session.removeAttribute("username");*//*
        *//*session.setMaxInactiveInterval(3000);*//*
        response.sendRedirect(request.getContextPath()+"/longin.jsp?info="+flag);*/
%><script type="text/javascript">

    window.confirm("登录失败")

</script>

<%
    }
 %>
</body>
</html>
